var ZYRequestClient = require("../../../../utils/zy-request");
var requestClient;
const app = getApp();
Page({
  data:{
    companyContractList:[],
    navbarData:{
      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
      title: '文件类型', //导航栏 中间的标题
      white:true
     },
     // 导航头的高度
     height: app.globalData.height * 2 + 20
  },
  onLoad() {
    requestClient = new ZYRequestClient();
  },
  // 加载文件类型列表
  loadCompanyContractTypeList(){
    var _this = this;
    var defaultCompany = wx.getStorageSync('defaultCompany');
    if(defaultCompany == ''){
      defaultCompany = { id:0 };
    }
    requestClient.getCompanyContractTypeList(defaultCompany.id,function(res){
      _this.setData({
        companyContractList:res.data.data
      });
    });
  },
  onShow(){
    this.loadCompanyContractTypeList();
  },
  // 点击跳转文件小类
  bindContractClick(e){
    var contract = e.currentTarget.dataset.contract;
    wx.navigateTo({
      url: '../contracttypesub/index?id=' + contract.id +"&name=" + contract.name
    })
  }
})
